package com.dragon.modules.yuegou.mapper.merchant;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.dragon.modules.yuegou.entity.merchant.MerchantSalesEntity;
import com.dragon.modules.yuegou.model.busd.District;
import com.dragon.modules.yuegou.model.merchant.MerchantSales;
import com.dragon.modules.yuegou.model.merchant.SalesReportModel;
import com.dragon.modules.yuegou.model.merchant.SalesReportQuery;
import com.dragon.modules.yuegou.query.merchant.SalesQuery;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 * 商铺销售额 Mapper接口
 *
 * @author pbuilder generated
 * @date 2019-05-20 10:37:56
 * @version 2.0
 */
@Component("merMerchantSalesMapper")
public interface MerchantSalesMapper extends BaseMapper<MerchantSalesEntity> {

    /**
     * 员工版查询销售数据
     * @param page
     * @param groupList
     * @param query
     * @return
     */
    List<MerchantSales> search(IPage page, @Param("groupList") List<String> groupList, @Param("query") SalesQuery query);

    /**
     * 集团版查询销售数据
     * @param page
     * @param query
     * @return
     */
    IPage<MerchantSales> searchMerchantList(IPage page, @Param("query") SalesQuery query);

    /**
     * 导出集团版销售数据
     * @param query
     * @return
     */
    List<MerchantSales> searchMerchantList(@Param("query") SalesQuery query);

    /**
     * 按商圈获取销售基本信息
     * @param reportQuery
     * @return
     */
    SalesReportModel getSalesOfDayByBusd(@Param("reportQuery") SalesReportQuery reportQuery);

    /**
     * 按商圈获取销售--按业态
     * @param page
     * @param reportQuery
     * @return
     */
    IPage<SalesReportModel> getSalesOfDayByBtType(IPage page, @Param("reportQuery") SalesReportQuery reportQuery);

    /**
     * 按商圈获取销售--按商户
     * @param page
     * @param reportQuery
     * @return
     */
    IPage<SalesReportModel> getSalesOfDayByMerchant(IPage page, @Param("reportQuery") SalesReportQuery reportQuery);

    /**
     * 根据业态ID获取报表
     * @param reportQuery
     * @return
     */
    List<Map<String,Object>> getSalesOfDayByBtTypeForDay(@Param("reportQuery")SalesReportQuery reportQuery);

    /**
     * 根据商户ID获取报表
     * @param reportQuery
     * @return
     */
    List<Map<String,Object>> getSalesOfDayByMerchantForDay(@Param("reportQuery")SalesReportQuery reportQuery);


    /**
     * 商圈销售数据-按月
     * @param reportQuery
     * @return
     */
    SalesReportModel getSalesOfMonthByBusd(@Param("reportQuery")SalesReportQuery reportQuery);

    /**
     * 按商圈获取销售--按业态
     * @param page
     * @param reportQuery
     * @return
     */
    IPage<SalesReportModel> getSalesOfMonthByBtType(IPage page, @Param("reportQuery")SalesReportQuery reportQuery);

    /**
     * 按商圈获取销售--按商户
     *
     * @param page
     * @param reportQuery
     * @return
     */
    IPage<SalesReportModel> getSalesOfMonthByMerchant(IPage page, @Param("reportQuery") SalesReportQuery reportQuery);

    /**
     * 查询出所有商圈id和商圈名称
     * @return
     */
    List<District> findBusdInfo();
}
